﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListDistrict.ascx.cs" Inherits="Pantry.Web.Users.Controls.ListDistrict" %>
<%@ Register TagPrefix="CC1" Namespace="SiteUtils" Assembly="CollectionPager" %>




<asp:UpdatePanel ID="UpdatePanelContact" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="CollectionPager" EventName="Click" />
    </Triggers>

    <ContentTemplate>
        <link rel="stylesheet" href="../Resources/css/lachv.css" />
        
        <div class="g_12">
	        <div class="widget_header ">
	            <div class="listBottomTop" style="float: left">
		            <div class="buttonTop">
		                <asp:Button ID="Button6" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterWClicked" Text="W X Y Z"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="Button5" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterSClicked" Text="S T U V"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="Button4" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterOClicked" Text="0 P Q R"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="Button3" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterKClicked" Text="K L M N"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="ButtonFilterF" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterFClicked" Text="F G H I J"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="ButtonFilterA" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterAClicked" Text="A B C D E"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="ButtonFilter0" runat="server" CssClass="simple_buttons" OnClick="ButtonFilter0Clicked" Text="0-9"/>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="Button7" runat="server" CssClass="simple_buttons" OnClick="ButtonFilterAllClicked" Text="ALL"/>
		            </div>
	            </div>
		        <div class="listBottomTop">
        		    
		            <div class="buttonTop checkboxListProgram">
                        <span style="float: left; margin-top: 3px">
                            <asp:CheckBox ID="CheckBoxIncludeActivate" runat="server" CssClass="simple_form magintop10" AutoPostBack="True" Checked="true" />
                        </span>
                        <label class="simple_form" for="CheckBoxIncludeActivate">in-active</label>
		            </div>
		            <div class="buttonTop">
		                <asp:Button ID="ButtonCreate" OnClick="ButtonCreateClicked" runat="server" CssClass="simple_buttons" Text="Create"/>
		            </div>
            
			        <div class="clear"></div>
		        </div>
	        </div>
        	
	        <div class="clear"></div>
	        <div class="widget_contents noPadding">
		        <table class="tables">
			        <thead>
				        <tr>
					        <th class="sorting">
					            <asp:LinkButton OnClick="LinkButtonClicked" ID="TrustDistrictName" runat="server"  >District Name</asp:LinkButton>
					        </th>
					        <th class="sorting">
					            <asp:LinkButton OnClick="LinkButtonClicked" ID="Description" runat="server"  >Description</asp:LinkButton>
					        </th>
					        <th class="sorting">
					            <asp:LinkButton OnClick="LinkButtonClicked" ID="TrustRegionName" runat="server" >Region</asp:LinkButton>
					        </th>
					        <th class="sorting">
					            <asp:LinkButton OnClick="LinkButtonClicked" ID="IsActive" runat="server" Text="Is Active?"/>
					        </th>
				        </tr>
			        </thead>
			        <tbody>
			            <asp:Repeater runat="server" ID="RepeaterDistricts">
			            <ItemTemplate>
				            <tr>
					            <td>
					                <a onclick="return confirmDialogue('<%# Eval("IsActive")%>'.toLowerCase());" 
					                    href="DistrictDetail.aspx?TrustRegionId=<%# Eval("TrustRegionId") %>&TrustDistrictId=<%# Eval("TrustDistrictId") %>">
					                    <%# Eval("TrustDistrictName")%>
					                </a>
					                <asp:HiddenField runat="server" ID="HiddenFieldDepartmentId"/>
					            </td>
					            <td><%# Eval("Description")%></td>
					            <td><%# Eval("TrustRegionName")%></td>
					            <td><%# Eval("IsActive")%></td>
				            </tr>
				        </ItemTemplate>
				        </asp:Repeater>
    				    
    				    
			        </tbody>
		        </table>
	        </div>
	        <div class="dtPagination">
                <CC1:CollectionPager ID="CollectionPager" runat="server" BackText="Back" FirstText="First" ShowLabel="False" ShowFirstLast="False" NextText="Next" ResultsLocation="None" PageNumbersSeparator=" "
                PagingMode="PostBack" HideOnSinglePage="false">
                </CC1:CollectionPager>
            </div>
        	
        </div>
    	
	    <script type="text/javascript">
    		function confirmDialogue(aaa){
    			if (aaa=='yes') {
    				return true;
    			}
    			if(confirm('Do you want to make this Trust District active?'))
    				return true;
    			return false;
    		}
    	    	
    	</script>
    </ContentTemplate>	
</asp:UpdatePanel>